//
//  ZYCTeaLeaveHeaderView.m
//  ZDSC
//
//  Created by 张威 on 2021/10/26.
//

#import "ZYCTeaLeaveHeaderView.h"
@interface ZYCTeaLeaveHeaderView ()


@property (nonatomic, strong) UIImageView *iconImageView;


@end
@implementation ZYCTeaLeaveHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.iconImageView];
        [self addSubview:self.titleLabel];
        
        [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.centerX.equalTo(self);
            make.size.mas_equalTo(CGSizeMake(42.0f, 42.0f));
        }];
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.iconImageView.mas_bottom).offset(8.f);
            make.left.right.equalTo(self);
        }];
        
        
    }
    return self;
}

#pragma mark - getters
-(UIImageView *)iconImageView{
    if (!_iconImageView) {
        _iconImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"headerPlace"]];
        _iconImageView.contentMode = UIViewContentModeScaleAspectFit;
        _iconImageView.layer.cornerRadius = 21.0f;
        _iconImageView.layer.masksToBounds = YES;
    }
    return _iconImageView;
}

-(UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [UILabel LabelWithFont:kCustomFont(@"PingFangSC-Regular", 13.0f) titleColor:HEX_RGB(@"#999999") textAlignment:ZZTextAlignmentCenter];
    }
    return _titleLabel;
}

@end
